<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title>OJ back-stage</title>
    <meta name="description" content="with selectable items(single &amp; multiple) and custom icons" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
    <link rel="stylesheet" href="/assets/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/assets/css/font-awesome.min.css" />
    <link rel="stylesheet" href="/assets/css/chosen.css" />
    <link rel="stylesheet" href="/assets/css/jquery-ui.custom.datepicer.min.css" />
    <link rel="stylesheet" href="/assets/css/ace.min.css" />
    <link rel="stylesheet" href="/assets/css/animate.min.css" />

    <script src="/js/date/WdatePicker.js"></script>

    <link rel="stylesheet" href="/assets/css/cig.css" />
    <!--[if lte IE 9]>
    <link rel="stylesheet" href="/assets/css/ace-part2.min.css" />
    <![endif]-->
    <!--<link rel="stylesheet" href="/assets/css/ace-skins.min.css" />
            <link rel="stylesheet" href="/assets/css/ace-rtl.min.css" />-->

    <!--[if lte IE 9]>
    <link rel="stylesheet" href="/assets/css/ace-ie.min.css" />
    <![endif]-->

    <script src="/assets/js/ace-extra.min.js"></script>

    <!--[if lte IE 8]>
    <script src="/js/html5shiv.js"></script>
    <script src="/assets/js/respond.min.js"></script>
    <![endif]-->
    <!--<script src="/js/jquery.min.js"></script>-->
    <!--<script src="/js/bootstrap.min.js"></script>-->

</head>

<body class="no-skin">
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try{ace.settings.check('main-container' , 'fixed')}catch(e){}
    </script>
    <div id="sidebar" class="sidebar responsive">
        <script type="text/javascript">
            try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
        </script>
        <div class="rq-logo">
            <a class="navbar-brand" href="<?php echo U('Index/index');?>">
                <span>OJ-Backstage</span>
            </a>
        </div>
        <ul class="nav nav-list">
            <?php if(is_array($menus)): foreach($menus as $m_k=>$m_val): ?><li <?php if($action == $m_k): ?>class="active"<?php endif; ?> >
                    <a href="<?php echo ($m_val['url']); ?>" <?php if(!empty($m_val["list"])): ?>class="dropdown-toggle"<?php endif; ?> >
                        <i class="menu-icon <?php echo ($m_val['label']); ?>"></i>
                        <span class="menu-text"><?php echo ($m_val["name"]); ?></span>
                        <?php if(!empty($m_val["list"])): ?><b class="arrow fa fa-angle-down"></b><?php endif; ?>
                    </a> <b class="arrow"></b>
                    <?php if(!empty($m_val["list"])): ?><ul class="submenu">
                            <?php if(is_array($m_val["list"])): foreach($m_val["list"] as $sub_k=>$sub_val): ?><li class="">
                                    <a href="<?php echo ($sub_val['url']); ?>">
                                        <i class="menu-icon fa fa-caret-right"></i><?php echo ($sub_val["name"]); ?></a>
                                    <b class="arrow"></b>
                                </li><?php endforeach; endif; ?>
                        </ul><?php endif; ?>
                </li><?php endforeach; endif; ?>
        </ul>
        <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
            <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
        </div>
    </div>
    <div class="main-content">

        <div class="breadcrumbs td-navbar" id="breadcrumbs">
            <script type="text/javascript">
                try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
            </script>
            <div class="btn-group pull-right">
                <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                    <i class="fa fa-user"></i>
                    <span class="hidden-sm hidden-xs">hello <?php echo (($session["USER"]["nickname"])?($session["USER"]["nickname"]):$session['USER']['user_id']); ?></span>
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    <li><a href="<?php echo U('User/loginOut');?>">退出</a></li>
                </ul>
            </div>

            <!-- /.breadcrumb -->
        </div>

<div class="page-content">
    <!-- content starts -->
    <div class="cig-page-header">
        <ul class="breadcrumb">
            <li>
                <a href="<?php echo U('/Problem/index');?>">竞赛&作业管理</a>
            </li>

            <li class="active">添加竞赛&作业</li>
        </ul>
    </div>
   <div class="row">
    <div class="col-md-12">
        <div class="box-inner">

            <div class="box-content">

                <div class="row">
                    <div class="col-xs-12">
                        <br />
                        <form class="form-horizontal" action="<?php echo U('/Contest/save');?>" method="POST">

                            <div class="form-group">
                                <label for="" class="col-sm-2 control-label no-padding-right"><em>*</em>Title:</label>
                                <div class="col-sm-10">
                                    <input type="text" class="col-xs-10 col-sm-5 required" name="title" id="" value="<?php echo ($info['title']); ?>">
                                    <span class="cig-tip"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right" for=""><em>*</em>Start Time:</label>
                                <div class="col-sm-10">
                                    <div class="input-group col-sm-5">
                                        <input type="text" value="<?php echo ($now); ?>" name="start-time" id="start-time" class="form-control date-picker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:00' })" >
                                        <span class="input-group-addon"> <i class="fa fa-calendar bigger-110"></i> </span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right" for=""><em>*</em>End Time:</label>
                                <div class="col-sm-10">
                                    <div class="input-group col-sm-5">
                                        <input type="text" value="<?php echo ($now); ?>" name="end-time" id="end-time" class="form-control date-picker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:00' })" >
                                        <span class="input-group-addon"> <i class="fa fa-calendar bigger-110"></i> </span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="" class="col-sm-2 control-label no-padding-right"><em>*</em>Problems:</label>
                                <div class="col-sm-10">
                                    <input type="text" class="col-xs-10 col-sm-5 required" name="problems" id="" value="<?php echo ($info['plist']); ?>">
                                    <span class="cig-tip"></span>
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label no-padding-right" for=""><em>*</em>Public:</label>
                                <div class="col-sm-10">
                                    <div class="col-sm-5 no-padding">
                                        <select class="col-xs-10 col-sm-5" name="public" data-placeholder="public" style="width: 100%">
                                            <option value="0">Public</option>
                                            <option value="1">Private</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right" for=""><em>*</em>Language:</label>
                                <div class="col-sm-10">
                                    <div class="col-sm-5 no-padding">
                                        <select class="col-xs-10 col-sm-5" multiple="multiple" name="language[]" data-placeholder="Language" style="width: 100%;height: auto">
                                            <?php if(is_array($language)): foreach($language as $key=>$val): ?><option value="<?php echo ($val['value']); ?>" selected="selected"><?php echo ($val["name"]); ?></option><?php endforeach; endif; ?>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="" class="col-sm-2 control-label no-padding-right"><em>*</em>Users:</label>
                                <div class="col-sm-10">
                                    <textarea name="form-required-limit" class="col-xs-10 col-sm-5" name="ulist"></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="" class="col-sm-2 control-label no-padding-right"><em>*</em>Description:</label>
                                <div class="col-sm-8">
                                    <!-- 加载编辑器的容器 -->
                                    <script id="description" name="description" ></script>
                                    <!-- 配置文件 -->
                                    <script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
                                    <!-- 编辑器源码文件 -->
                                    <script type="text/javascript" src="/ueditor/ueditor.all.js"></script>
                                    <!-- 实例化编辑器 -->
                                    <script type="text/javascript">
                                        var ue = UE.getEditor('description',{
                                            toolbars: [[
                                                'fullscreen', 'source', '|', 'undo', 'redo', '|',
                                                'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
                                                'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
                                                'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
                                                'directionalityltr', 'directionalityrtl', 'indent', '|',
                                                'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|', 'emotion',  'insertcode', '|',
                                                'horizontal', 'date', 'time', 'spechars','|',
                                                'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
                                                'print', 'preview', 'searchreplace', 'help', 'drafts'
                                            ]]
                                        });
                                    </script>
                                </div>
                            </div>
                            <div class="clearfix form-actions">
                                <div class="col-md-3 col-xs-3"></div>
                                <div class="col-md-9 col-xs-9">
                                    <button type="submit" class="save-btn btn btn-success"><i class="ace-icon fa fa-check"></i> 保 存 </button>
                                    <button type="button" class="btn btn-grey" onclick="javascript:history.go(-1)"><i class="ace-icon fa fa-close bigger-110"></i> 取 消 </button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--/row-->

</div>

    <!--/row-->

</div>
<!--content-->
<div> </div>

</div>
<div class="footer">
    <div class="footer-inner">
        <!-- #section:basics/footer -->
        <div class="footer-content">
            <span class="bigger-120">
                <span class="blue bolder">&copy; </span>
                <p>Base on <a href='http://code.google.com/p/hustoj/'>HUSTOJ</a>
                    Copyright@<a href='http://comp.buct.edu.cn'>Computer Teaching and Experiment Center</a>
                    Administrator:lyong@mail.buct.edu.cn</p>
            </span>
        </div>
        <!-- /section:basics/footer -->
    </div>
</div>
<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse"> <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i> </a> </div>

<!--[if !IE]> -->
<script type="text/javascript">
    window.jQuery || document.write("<script src='/assets/js/jquery.min.js'>"+"<"+"/script>");
</script>

<!-- <![endif]-->

<!--[if IE]>
<script type="text/javascript">
    window.jQuery || document.write("<script src='/assets/js/jquery1x.min.js'>"+"<"+"/script>");
</script>
<![endif]-->
<script type="text/javascript">
    if('ontouchstart' in document.documentElement) document.write("<script src='/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
</script>
<script src="/assets/js/bootstrap.min.js"></script>

<!-- page specific plugin scripts -->

<!-- ace scripts -->
<script src="/assets/js/ace-elements.min.js"></script>
<script src="/assets/js/jquery-ui.custom.datepicer.min.js"></script>
<script src="/assets/js/ace.min.js"></script>

<!-- inline scripts related to this page -->
<script src="/assets/js/chosen.jquery.min.js"></script>
<script src="/assets/js/base.js"></script>
<script src="/assets/js/echarts-all.js"></script>

</body>
</html>